import urllib
from urllib import parse


class Config:
    """
        配置类
    """
    _instance = None

    def __init__(self):
        self.username = urllib.parse.quote_plus('')
        self.password = urllib.parse.quote_plus('')
        self.host = ''
        self.port = ''
        self.database = ''
        self.selectionTimeout = 5000
        # 是否开启debug信息
        self._debug = True
        # 百度appKey
        self.ak = ''

    def __new__(cls, *args, **kwargs):
        if cls._instance is None:
            cls._instance = object.__new__(cls)
        return cls._instance

    def is_debug(self):
        return self._debug
